config = {
    "tabTop": '\t\t\t\t\t\t\t'
}


def main():
    while True:
        menum()
        choice = int(input('请选择 '))
        if choice in [0, 1, 2, 3, 4, 5, 6, 7]:
            if choice == 0:
                answer = input('您确定要退出 系统吗？y/n ')
                if answer == 'y' or answer =='Y':
                    print('谢谢使用')
                    break
                else:
                    continue
            elif choice == 1:
                insert()
            elif choice == 2:
                search()
            elif choice == 3:
                delete()
            elif choice == 4:
                modify()
            elif choice == 5:
                sort()
            elif choice == 6:
                total()
            elif choice == 7:
                show()



def menum():
    print("===================================学生信息管理系统======================================")
    print("-----------------------------------功能菜单---------------------------------------------")
    printMenuTitle(1, '录入学生信息')
    printMenuTitle(2, '查找学生信息')
    printMenuTitle(3, '删除学生信息')
    printMenuTitle(4, '修改学生信息')
    printMenuTitle(5, '学生信息排序')
    printMenuTitle(6, '统计学生信息')
    printMenuTitle(7, '显示所有学生信息')
    printMenuTitle(0, '退出系统')
    print("-------------------------------------------------------------------------------------")

def insert():
    pass
def search():
    pass
def delete():
    pass
def modify():
    pass
def sort():
    pass
def total():
    pass
def show():
    pass
def printMenuTitle(index, tip):
    print(f'{config["tabTop"]} {str(index)} {tip}')


if __name__ == '__main__':
    main()
